﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using com.intel.wizard.model;
using com.intel.wizard.conditionalMode;
using com.intel.wizard.style;
using com.intel.wizard.xml;
using System.Xml;
using System.Xml.Serialization;
using com.intel.wizard.interaction;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //STEP 1
            Text service = new Text( "text1", 30, 5, false, "requiredField" );
            service.ID = "id1";
            Text owner = new Text("text2", 30, 5, false, "requiredField");
            owner.ID = "id2";
            Text pass = new Text("testPassword1", 30, 5, true, "requiredField");
            pass.ID = "id3";

            Layout layout1 = new Layout();
            layout1.AddText(service);
            layout1.AddText(owner);
            layout1.AddText(pass);

            Step step1 = new Step();
            step1.name = "Step Name";
            step1.ID = "Step1";
            step1.description = "This is the description of the step.";
            step1.AddLayout(layout1);

            //STEP 2
            Step step2 = new Step();
            step2.name = "Customization of Accounting Records";
            step2.ID = "Step2";
            step2.description = "Customization of Accounting Records";

            List<string> listGroup2 = new List<string>();
            listGroup2.Add("Per Use");
            listGroup2.Add("Per Connection");
            Group group2 = new Group( "dropdown", listGroup2 );
            group2.label = "Billing:";
            group2.ID = "group2";

            Layout layout2a = new Layout();
            layout2a.AddGroup(group2);

            step2.AddLayout(layout2a);

            //STEP 3
            Group group3 = new Group();
            group3.label = "Select Entity:";
            group3.type = "list";
            group3.addItem("OEM");
            group3.addItem("SP");
            group3.ID = "group3";

            TableData table = new TableData(5, 1, "Attributes Associated to Promotions");
            table.ID = "table";

            Layout layout3 = new Layout();
            layout3.AddGroup(group3);
            layout3.AddTable(table);

            Step step3 = new Step();
            step3.name = "Customization of Entities";
            step3.ID = "Step3";
            step3.AddLayout(layout3);
            step3.description = "Customization of Entities";

            WizardModel model = new WizardModel();
            model.AddStep(step1);
            model.AddStep(step2);
            model.AddStep(step3);

            model.actionsAtEnd = true;

            DoAction postaction = new DoAction();
            postaction.assemblyName = "SerializeResults.dll";
            postaction.impInterface = "com.intel.wizard.WizardUtilities.IAction";
            postaction.method = "execute";

            model.postAction = postaction;

            XmlOperations xml = new XmlOperations();
            xml.serialize(model, "example-cond.xml");
        }
    }
}
